<template>
  <div class="rose-echart"><HyEchart :options="option"></HyEchart></div>
</template>

<script setup lang="ts">
import HyEchart from '@/base-ui/HyEchart/hy-echart.vue';
import { computed } from 'vue';
const props = defineProps<{
  xAxisData: string[];
  seriesData: number[];
}>();
const option = computed(() => {
  return {
    title: {
      text: ''
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        label: {
          backgroundColor: '#6a7985'
        }
      }
    },
    legend: {
      data: ['分类销量统计']
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        boundaryGap: false,
        data: props.xAxisData
      }
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: [
      {
        name: '分类销量统计',
        type: 'line',
        stack: 'Total',
        areaStyle: {},
        emphasis: {
          focus: 'series'
        },
        data: props.seriesData
      }
    ]
  };
});
</script>

<style scoped></style>
